import { BasicColumn } from "/@/components/Table";
import {render} from '/@/utils/common/renderUtils';

//列表数据
export const columns: BasicColumn[] = [
  {
    title: '名称',
    align: "center",
    dataIndex: 'name'
  },
  {
    title: '税号',
    align: "center",
    dataIndex: 'businessLicenseNo'
  },
  {
    title: '法人姓名',
    align: "center",
    dataIndex: 'legalName'
  },
  {
    title: '开户名',
    align: "center",
    dataIndex: 'bankAccount'
  },
  {
    title: '开户号',
    align: "center",
    dataIndex: 'bankCard'
  },
  {
    title: '开户行',
    align: "center",
    dataIndex: 'bankName'
  },
  {
    title: '联系人姓名',
    align: "center",
    dataIndex: 'contactName'
  },
  {
    title: '联系人电话',
    align: "center",
    dataIndex: 'contactPhone'
  },
  {
    title: '状态',
    align: "center",
    dataIndex: 'status',
    slots: { customRender: 'statusSlot' },
  },
];

//服务公司关联用户列表数据
export const caishuiMiddleUserColumns: BasicColumn[] = [
  {
    title: '关联服务公司',
    dataIndex: 'companyName',
    width: 120,
  },
  {
    title: '手机号',
    dataIndex: 'username',
    width: 100,
  },
  {
    title: '姓名',
    dataIndex: 'realname',
    width: 100,
  },
  // {
  //   title: '头像',
  //   dataIndex: 'avatar',
  //   width: 120,
  //   customRender: render.renderAvatar,
  // },
  {
    title: '角色',
    dataIndex: 'middleOptAuth',
    width: 80,
    slots: { customRender: 'middleOptAuthSlot' },
  },
  {
    title: '状态',
    dataIndex: 'status',
    width: 80,
    slots: { customRender: 'statusSlot' },
  },
  {
    title: '创建时间',
    sorter: true,
    dataIndex: 'createTime',
    width: 100,
  },
];

//中台用户列表数据
export const caishuiMiddleUserSubColumns: BasicColumn[] = [
  {
    title: '手机号',
    dataIndex: 'username',
    width: 100,
  },
  {
    title: '姓名',
    dataIndex: 'realname',
    width: 100,
  },
  // {
  //   title: '昵称',
  //   dataIndex: 'nickname',
  //   width: 120,
  // },
  // {
  //   title: '头像',
  //   dataIndex: 'avatar',
  //   width: 120,
  //   customRender: render.renderAvatar,
  // },
  {
    title: '角色',
    dataIndex: 'middleOptAuth',
    width: 80,
    slots: { customRender: 'middleOptAuthSlot' },
  },
  {
    title: '状态',
    dataIndex: 'status',
    width: 80,
    slots: { customRender: 'statusSlot' },
  },
  {
    title: '创建时间',
    sorter: true,
    dataIndex: 'createTime',
    width: 100,
  },
];

//记账子单元交易流水列表
export const transactionFlowColumns: BasicColumn[] = [
  {
    title: '服务公司名称',
    align: "center",
    dataIndex: 'companyName',
    customRender:({text}) =>{
      return !text ? "-" : text;
    },
  },
  {
    title: '记账子单元名称',
    align: "center",
    dataIndex: 'dmanam',
    customRender:({text}) =>{
      return !text ? "-" : text;
    },
  },
  {
    title: '记账子单元编号',
    align: "center",
    dataIndex: 'dmanbr',
    customRender:({text}) =>{
      return !text ? "-" : text;
    },
  },
  {
    title: '记账流水号',
    align: "center",
    dataIndex: 'trxnbr',
    customRender:({text}) =>{
      return !text ? "-" : text;
    },
  },
  {
    title: '交易金额',
    align: "center",
    dataIndex: 'trxamt',
    customRender:({text}) =>{
      return !text ? "0.00" : parseFloat(text).toFixed(2);
    },
  },
  {
    title: '交易方向',
    align: "center",
    dataIndex: 'trxdir',
    slots: { customRender: 'trxdirSlot' },
  },
  {
    title: '交易时间',
    align: "center",
    dataIndex: 'trxtim',
    customRender:({text}) =>{
      return !text ? "-" : text;
    },
  },
  {
    title: '收方/付方名称',
    align: "center",
    dataIndex: 'rpynam',
    customRender:({text}) =>{
      return !text ? "-" : text;
    },
  },
  {
    title: '收方/付方账号',
    align: "center",
    dataIndex: 'rpyacc',
    customRender:({text}) =>{
      return !text ? "-" : text;
    },
  },
  {
    title: '交易摘要',
    align: "center",
    dataIndex: 'trxtxt',
    customRender:({text}) =>{
      return !text ? "-" : text;
    },
  },
  {
    title: '内部编号',
    align: "center",
    dataIndex: 'narinn',
    customRender:({text}) =>{
      return !text ? "-" : text;
    },
  },
  {
    title: '记账方式',
    align: "center",
    dataIndex: 'autflg',
    slots: { customRender: 'autflgSlot' },
  },
];
